# coding:utf-8
import os
import shutil
from pathlib import Path


# d = r'\\10.244.134.184\dba_train\BIgdata專案\彩盒智能判定系統\photo_train\object_train_photo\source_photo'
d = r'F:\boxDetect\BoxF'
# d = r'\\10.244.134.184\dba_train\BIgdata專案\彩盒智能判定系統\photo_train\object_train_photo\source_xml'
prexxs = ['gray_AX140_','gray_AY140_','gray_AZ140_']
pdirs = [os.path.join(d,i[:-1]) for i in prexxs]
for prexx, pdir in zip(prexxs,pdirs):
    for i in os.listdir(pdir):
        finame = i.replace(prexx,'')
        print(finame)
        path = os.path.join(pdir,i)
        print(path)
        fpath = os.path.join(pdir,finame)
        print(fpath)
        os.rename(path,fpath)


